<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑博客类型</title>
</head>
<lui:context/>
<u:View basePath="/res-datum/blog" userJS="editBlogType" userCSS="editBlogType" delayLoadJs="false">
<body>
<lui:dialogBody>
    <lui:ajax url="${ctx }/sys/code/findCodeInfoByTypeId" id="findBlogCategoryAjax" data="{'codeTypeId':'blogType'}" 
        contentType="application/x-www-form-urlencoded" onSuccess="EditBlogTypePage.findCategorySucc" autoSend="true"/>
    <lui:ajax url="${ctx }/sys/code/deleteCodeByCodeValue" id="deleteBlogCategoryAjax" type="post" onSuccess="EditBlogTypePage.onDeleteBlogTypeSucc" 
        contentType="application/x-www-form-urlencoded" />
    <lui:ajax url="${ctx }/sys/code/editCodeInfo" id="editCodeInfoAjax" type="post" onSuccess="EditBlogTypePage.onEditBlogTypeSucc" 
        contentType="application/x-www-form-urlencoded" formQuery="#editCodeInfoFrm" formSubmit="true"/>
    <div style='margin-left:auto;margin-right:auto;display:table;width:100%;'>
        <div class='t-code-list-panel'>
            <button class='m-btn m-primary m-round-btn' onclick="EditBlogTypePage.addBlogType()"><i class='fa fa-fw fa-plus'></i>新增</button>
            <section class='code-list t-menu' id="blogCategoryList"></section>
        </div>
        <div class='t-code-edit-panel'>
            <form id="editCodeInfoFrm" class="m-cust m-narrow">
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="codeInfoName">名称：</label>
                        </div>
	                    <div class="col-xs-8">
	                        <input autofocus="autofocus" class='m-input form-control' id='codeInfoName' name='codeInfoName' 
	                           onchange="EditBlogTypePage.onValueChanged()" onblur="EditBlogTypePage.onBlogTypeNameChanged(this)" 
	                           data-validate='true' data-not-empty='true' 
	                           data-empty-text="博客类型名称不能为空" maxlength="18">
	                    </div>
                    </div>
                </div>
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="codeInfoValue">码值：</label>
                        </div>
	                    <div class="col-xs-8">
	                        <input class='m-input form-control' id='codeInfoValue' readonly="readonly" name='codeInfoValue'>
	                    </div>
                    </div>
                </div>
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="orderNumber">序号：</label>
                        </div>
	                    <div class="col-xs-8">
	                        <input class='m-input form-control' id='orderNumber' name='orderNumber' type="number" min="0"
	                           onchange="EditBlogTypePage.onValueChanged()">
	                    </div>
                    </div>
                </div>
                <div class="form-group m-narrow row">
                    <div class="col-xs-12">
                        <div class="col-xs-3">
                            <label class='m-label m-float-right' for="state">状态：</label>
                        </div>
	                    <div class="col-xs-8">
	                        <select class='m-input form-control' id='state' name='state' onchange="EditBlogTypePage.onValueChanged()">
		                        <option value="1" selected="selected">正常</option>
		                        <option value="0">禁用</option>
		                    </select>
	                    </div>
                    </div>
                </div>
                <input type='hidden' name='codeType.codeTypeId' value='blogType'>
                <input type='hidden' name='id'>
            </form>
        </div>
    </div>
</lui:dialogBody>
<lui:dialogFooter>
    <button class="btn btn-primary m-btn" type="button" onclick="EditBlogTypePage.saveBlogType()">保存</button>
    <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box" onclick="EditBlogTypePage.closeDialog()">关闭</button>
</lui:dialogFooter>
</body>
</u:View>
</html>